import handleFile from "@util/handleFile"

export default function createUpload() {
  const inputDom = document.createElement("input")
  inputDom.setAttribute("type", "file")
  inputDom.setAttribute("accept", "image/*")
  inputDom.setAttribute("multiple", "true")
  inputDom.click()
  inputDom.onchange = function (e: Event) {
    const fileList = (e.target as HTMLInputElement).files
    handleFile(fileList)
  }
};
